<?php

namespace App\Factory;

use App\Constants\ChannelTypeEnum;
use App\Services\Impl\OppoService;
use App\Services\Impl\VivoService;

/**
 * 上报服务简单工厂
 */
class ReportServiceFactory
{
    public static function createService($channelType)
    {
        return match ($channelType) {
            ChannelTypeEnum::OPPO->value => new OppoService(),
            ChannelTypeEnum::VIVO->value => new VivoService(),
            default                      => throw_error("factory error"),
        };
    }
}